<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-leave-edit" th:object="${leave}">
            <input id="businessKey" name="businessKey" th:field="*{businessKey}"  type="hidden">
            <div class="form-group">	
                <label class="col-sm-3 control-label">用户昵称：</label>
                <div class="col-sm-8">
                    <input id="userName" name="userName" th:field="*{userName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">请假天数：</label>
                <div class="col-sm-8">
                    <input id="days" name="days" th:field="*{days}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">请假起始日期：</label>
                <div class="col-sm-8">
                    <input id="fromDate" name="fromDate" th:field="*{fromDate}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">请假截止日期：</label>
                <div class="col-sm-8">
                    <input id="toDate" name="toDate" th:field="*{toDate}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">请假原因：</label>
                <div class="col-sm-8">
                    <input id="reason" name="reason" th:field="*{reason}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">当前节点：</label>
                <div class="col-sm-8">
                    <input id="step" name="step" th:field="*{step}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
				<label class="col-sm-3 control-label">审批意见：</label>
				<div class="col-sm-8">
					<select class="form-control" name="opinion">
						<option value="1">同意</option>
						<option value="2">拒绝</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">原因：</label>
				<div class="col-sm-8">
					<textarea id="approveReason" name="approveReason" class="form-control" placeholder="请输入文本">
					</textarea>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "workflow/leaveApr"
		$("#form-leave-edit").validate({
			rules:{
				opinion:{
					required:true,
				},
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-leave-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
